package ControlLayer;
import ModelLayer.OrderState;
import DBLayer.DBOrderState;
import java.util.ArrayList;

public class CtrOrderState {
    // <editor-fold defaultstate="collapsed" desc="Attributes & Constructors">
    private static CtrOrderState instance = null;
    DBOrderState dbOrderState = new DBOrderState();

    public CtrOrderState() {
    }
    // </editor-fold>

    // <editor-fold defaultstate="collapsed" desc="Methods">
    public static CtrOrderState getInstance() {
        if (instance == null) {
            instance = new CtrOrderState();
        }
        return instance;
    }

    public ArrayList<OrderState> getOrderStateList() {
        return dbOrderState.getOrderStateList();
    }

    public OrderState getOrderStateByID(int id) {
        return dbOrderState.getOrderStateByID(id);
    }

    public int addOrderState(OrderState orderState) {
        return dbOrderState.addOrderState(orderState);
    }

    public int updateOrderState(OrderState orderState, int id) {
        return dbOrderState.updateOrderState(orderState, id);
    }

    public void deleteOrderState(int id) {
        dbOrderState.deleteOrderState(id);
    }
    // </editor-fold>
}
